/**
 * 判断是否是同城
 * returnAddress: 退货地址
 * deliver: 收货地址
 */
export default (returnAddress, deliver) => (
    !$.isEmptyObject(returnAddress)
    && !$.isEmptyObject(deliver)
    && ['proviceFirstStageName', 'addressCitySecondStageName'].every((name, index) => {
        const isTrue = returnAddress[name] === deliver[name];
        const isCitySecondStageName = index === 1 && [returnAddress[name], deliver[name]].includes('市辖区');

        return isTrue || isCitySecondStageName;
    })
);
